<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>选择图片</title>
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/animate.min.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/style.min.css?v=4.0.0" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/plugins/webuploader/webuploader.css" rel="stylesheet" type="text/css">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/demo/webuploader-demo.min.css" rel="stylesheet" type="text/css">
	
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content">
    	<input type="hidden" id="image" />
    	<div class="row">
            <div class="col-sm-12"> 
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
						<div class="m-b-sm">
						
							<div id="uploader" class="wu-example">
                                <div class="queueList">
                                    <div id="dndArea" class="placeholder">
                                       	<div id="filePicker"></div>
                                        <p>或将照片拖到这里</p>
                                    </div>
                                </div>
                                <div class="statusBar" style="display:none;">
                                    <div class="progress">
                                        <span class="text">0%</span>
                                        <span class="percentage"></span>
                                    </div>
                                   	<div class="info"></div>
                                    <div class="btns">
                                        <!-- 注释掉   继续添加   图片按钮 <div id="filePicker2"></div> -->
                                        <div class="uploadBtn">开始上传</div>
                                   	</div>
                                </div>
                            </div>
                           
						</div>
						<br>
						<div class="form-group" style="text-align:center;">
                        	<button type="button" class="btn btn-w-m btn-success" onclick="selectObject();">保存</button>
                            <!-- <button type="button" style="margin-right: 10px;" class="btn btn-white pull-right m-t-n-xs" onclick="javascript:history.back(-1);">返回</button> -->
                        </div>
					</div>
                </div>
            </div>
            
        </div>


	</div>
    
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/jquery.min.js?v=2.1.4"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/content.min.js?v=1.0.0"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/toastr/toastr.min.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/layer/layer.js"></script>
    
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/webuploader/webuploader.min.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/demo/webuploader-demo.min.js"></script>
    
    <script type="text/javascript">
    
    var basePath = '<%=request.getContextPath()%>';
    var imageCompress = <%=request.getAttribute("imageCompress")%>;
    if(!imageCompress){//默认压缩300
    	imageCompress = 300;
    }
    //添加了一个网站新闻图片服务器文件夹
    var uploadUrl = basePath + "/common/uploadFile.idop?savetablefilename=newsImages";
    var BASE_URL = 'js/plugins/webuploader';
    
    toastr.options = {
  		  "closeButton": true,
  		  "debug": false,
  		  "progressBar": true,
  		  "positionClass": "toast-top-left",
  		  "showDuration": "400",
  		  "hideDuration": "1000",
  		  "timeOut": "3000",
  		  "extendedTimeOut": "1000",
  		  "showEasing": "swing",
  		  "hideEasing": "linear",
  		  "showMethod": "fadeIn",
  		  "hideMethod": "fadeOut"
  		}
    
  	//调用父类选择回调函数
	var selectObject = function(){
    	var imgUrl = $('#image').val();
    	if(imgUrl==""){
    		toastr.warning("请先选择或上传图片！", "提示");
    	}else{
    		var data = '{"image":"'+imgUrl+'"}'; 
    		parent.selectCallBack2(data);
    	}
	}
	
    </script>
    
</body>

</html>